package baidu.reader.common.model
{
    import flash.display.*;
    import flash.events.*;

    public class ScreenModel extends EventDispatcher
    {
        private var _stage:Stage;
        private var _stageHeight:Number;
        private var _stageWidth:Number;

        public function ScreenModel(param1:IEventDispatcher = null)
        {
            super(param1);
            return;
        }

        public function set stage(param1:Stage) : void
        {
            this._stage = param1;
			this._stageHeight = param1.height;
			this._stageWidth = param1.width;
            this._stage.addEventListener(Event.RESIZE, this.stageResizeHandler);
            this._stage.addEventListener(FullScreenEvent.FULL_SCREEN, this.fullScreenHandler);
            return;
        }

        private function fullScreenHandler(event:FullScreenEvent) : void
        {
            dispatchEvent(event);
            return;
        }

        private function stageResizeHandler(event:Event) : void
        {
            this._stageHeight = this._stage.stageHeight;
            this._stageWidth = this._stage.stageWidth;
            dispatchEvent(event);
            return;
        }

        public function get stageHeight() : Number
        {
            return this._stageHeight;
        }

        public function get stageWidth() : Number
        {
            return this._stageWidth;
        }

        public function get stage() : Stage
        {
            return this._stage;
        }

    }
}
